<?php

Route::get('/',function (){
    return '小样，请不要偷看了1';
});

//不需要登录
Route::post('login',   'AuthController@login');//登录
Route::get('logout', 'AuthController@logout');//退出登录
Route::get ('captcha','AuthController@captcha');//验证码
//订单管理
Route::group(['prefix' => 'order'], function(){
    Route::get ('/','OrderController@index'); //订单列表
    Route::post ('update','OrderController@update'); //订单信息更新
});
//需要登录
Route::group(['middleware'=>'auth:api'], function() {
    //文件上传
    Route::post ('upload','IndexController@upload');

    //分类管理
    Route::group(['prefix' => 'cate'], function(){
        Route::get('/','CategoryController@index');//分类管理_列表
        Route::post('update','CategoryController@update');//分类管理_更新
        Route::delete('destroy','CategoryController@destroy');//分类管理_删除
        Route::get('all','CategoryController@all');//分类管理_视频分类列表
    });

    //视频管理
    Route::group(['prefix' => 'video'], function(){
        Route::get ('/','VideoController@index');//视频管理_列表
        Route::post ('update','VideoController@update');//视频管理_新增
        Route::delete('destroy','VideoController@destroy');//视频管理_删除
        Route::get ('today','VideoController@todayVideos');//视频管理_当天视频列表
        Route::delete('destroy_all','VideoController@destroyAll');//视频管理_批量删除
    });

    //评论管理
    Route::group(['prefix' => 'comment'], function(){
        Route::get ('/','CommentController@index');//评论管理_列表
//        Route::post ('add','CommentController@add');//评论管理_新增
//        Route::post ('edit','CommentController@edit');//评论管理_编辑
        Route::delete ('destroy','CommentController@destroy');//评论管理_删除
        Route::delete ('destroy_all','CommentController@destroyAll');//评论管理_删除
    });

    //微信用户管理
    Route::group(['prefix' => 'user'], function(){
        Route::get ('/','UserController@index');//管理员用户_列表
        Route::get ('info','UserController@info');//用户信息
        Route::get ('wechat','UserController@wechat');//微信用户_列表
        Route::post('add','UserController@add');//用户_新增
        Route::post('edit','UserController@edit');//用户_编辑
        Route::post('destroy','UserController@destroy');//用户_删除
        Route::get ('all','UserController@all');//分类管理_用户列表
    });

    //管理员
    Route::group(['prefix' => 'manage'], function(){
        Route::get ('/','UserController@manage');
        Route::post('update','UserController@update');
        Route::delete('destroy','UserController@destroy');
    });

    //模板消息
    Route::group(['prefix' => 'tmplmsg'], function(){
        Route::get ('/','TmplmsgController@index');
        Route::post('update','TmplmsgController@update');
        Route::post('push','TmplmsgController@push');
        Route::post('token','TmplmsgController@token');
    });

    //客服消息
    Route::group(['prefix' => 'custom'], function(){
        Route::get ('/','CustomController@index');
    });

    //数据分析
    Route::group(['prefix' => 'analy'], function(){
        Route::get ('/','AnalyController@index');
    });
    //formid数据分析
    Route::group(['prefix' => 'formid'], function(){
        Route::get ('/','AnalyController@formId');
    });
    //视频数据统计分析 （阅读/点赞/收藏）
    Route::group(['prefix' => 'videoscount'], function(){
        Route::get ('/','AnalyController@videosCount');
    });

    //综合数据统计
    Route::group(['prefix' => 'count'], function(){
        Route::get ('/','CountController@index');
    });
    Route::group(['prefix' => 'countlog'], function(){
        Route::get ('/','CountLogController@index');
    });

    //配置信息
    Route::group(['prefix' => 'config'], function(){
        Route::get ('/','ConfigController@getAll');
        Route::get ('msg','ConfigController@getMsg');
        Route::post ('update','ConfigController@update'); //更新配置信息
    });

    //商城
    Route::group(['prefix' => 'mall'], function(){
        Route::get ('/','MallController@index'); //商品列表
//        Route::get ('info','MallController@info'); //商品详情
        Route::post ('update','MallController@update'); //商品信息更新
        Route::delete ('destroy','MallController@destroy'); //商品删除
        Route::delete ('destroy_all','MallController@destroyAll'); //商品批量删除
    });


});
